package com;

import com.event.MyEventPublish;
import com.initializer.MyInitializerThirdApplicationContextInitializer;
import com.listener.MySecondListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * Copyright (c)  by www.leya920.com
 * All right reserved.
 * Create Date: 2021-01-03 10:04
 * Create Author: xuweiwei
 * File Name: Application.java
 * Last version:  1.0
 * Function: //TODO
 * Last Update Date: 2021-01-03 10:04
 * Last Update Log:
 * Comment: //TODO
 **/
@SpringBootApplication
public class ApplicationMyinitlizerTest {


	@Autowired
	private MyEventPublish myEvent;

	public static void main(String[] args) {
		/*
		加载三种方案
		1 META-INF下
		2 application.properties
		3 程序设置
		 */


		SpringApplication application = new SpringApplication(ApplicationMyinitlizerTest.class);
		application.addInitializers(new MyInitializerThirdApplicationContextInitializer()); //
		application.addListeners(new MySecondListener());
		application.run(args);



	}

	void test() {
		myEvent.publish();
	}
}
